<#assign tableName = "${table.controllerName}"?replace("Controller","")>
<#assign uncapTableName = "${tableName}"?uncap_first>
package ${package.ServiceImpl};

import lombok.AllArgsConstructor;
import ${package.Service}.${table.serviceName};
import org.springframework.stereotype.Service;
import ${package.Parent}.core.domain.aggregatemodel.${tableName};
import ${package.Parent}.core.domain.aggregatemodel.Del${tableName};
import ${package.Parent}.core.application.command.Add${tableName}Command;
import ${package.Parent}.core.application.command.Update${tableName}Command;
import ${package.Parent}.core.application.command.Del${tableName}Command;
import ${package.Parent}.core.application.convert.AppConverter;
import ${package.Parent}.core.domain.service.${tableName}DomainService;

/**
 * <p>
 * ${table.comment!} 服务实现类
 * </p>
 *
 * @author ${author}
 * @since ${date}
 */
@Service
@AllArgsConstructor
public class ${table.serviceImplName}  implements ${table.serviceName} {

    private final ${tableName}DomainService ${uncapTableName}DomainService;

    private final AppConverter appConverter;
    /**
     * 新增
     */
    @Override
    public ${tableName} add${tableName}(Add${tableName}Command add${tableName}Command){
        ${tableName} ${uncapTableName} = appConverter.add${tableName}CommandTo${tableName}(add${tableName}Command);
        return ${uncapTableName}DomainService.add${tableName}(${uncapTableName});
    }

    /**
     * 删除
     */
    @Override
    public void del${tableName}(Del${tableName}Command del${tableName}Command){
        Del${tableName} del${tableName} = appConverter.del${tableName}CommandToDel${tableName}(del${tableName}Command);
        ${uncapTableName}DomainService.del${tableName}(del${tableName});
    }

    /**
     * 修改
     */
    @Override
    public ${tableName} update${tableName}(Update${tableName}Command update${tableName}Command){
        ${tableName} ${uncapTableName} = appConverter.update${tableName}CommandTo${tableName}(update${tableName}Command);
        return ${uncapTableName}DomainService.update${tableName}(${uncapTableName});
    }
}

